package day6;

public class PersonArray {
    public static void main(String[] args) {
        Person[] array = new Person[3];
        Person a = new Person("军哥", 25);
        Person b = new Person("洋葱哥", 23);
        Person c = new Person("路人王", 666);
        array[0] = a;
        array[1] = b;
        array[2] = c;
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);

        Person person = array[2];
        System.out.println(person.getName());
        System.out.println(array[2].getAge());
    }
}
